package com.abss.vote.controller;

import com.abss.vote.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {

    @Autowired
    RedisService redisService;

    @RequestMapping("/register")
    public String register(){
        return "front/register";
    }

    @RequestMapping("/uploadAudio")
    public String uploadAudio(){
        return "front/upload_audio";
    }
    @RequestMapping("/uploadVideo")
    public String uploadVideo(){
        return "front/upload_video";
    }
    @RequestMapping("/registerInfo")
    public String registerInfo(){
        return "front/register_info";
    }

    /**
     * 此方法为手动将数据库有效数据写入redis
     * @return
     */
    @ResponseBody
    @RequestMapping("/sqlserverToRedis")
    public String sqlserverToRedis(){
        redisService.sqlserverToRedis();
        return "yes";
    }

}
